package com.collabscm.waf.solution.persistence;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import javax.persistence.EntityManager;
import javax.persistence.QueryHint;
import javax.persistence.SqlResultSetMapping;

/**
 * 参考JPA的NamedNativeQuery定义
 *
 * @author Zeng Raoxing
 */
@Target({TYPE}) 
@Retention(RUNTIME)
public @interface NamedDynamicNativeQuery {

    /** 
     * Refers to the query when using the {@link EntityManager} 
     * methods that create query objects. 
     */
    String name();

    /** The query string in the Java Persistence query language */
    String query();
    
    /**
     * where条件间链接类型
     */
    WhereJoinType joinType();

    /** Vendor-specific query hints */
    QueryHint[] hints() default {};

    /** The class of the result */
    Class resultClass() default void.class; 

    /** The name of a {@link SqlResultSetMapping}, as defined in metadata */
    String resultSetMapping() default "";
	
}
